/*
 * @Author: yl
 * @Date: 2024-04-09 16:47:33
 * @LastEditTime:  2024-04-09 16:47:33
 * @LastEditors: Please set LastEditors
 * @Description: 溯源码扫码记录接口 sheep-information
 */
import xjaxios from "@/api/axios-source_trace";

export default {
  /**
   * @description: 获取 *代表必填
   * @param {String/Number} page *
   * @param {String/Number} size *
   * @param {Object} entity {componyId: 1} *
   * @param {String} order 排序方式 ASC DESC 默认ASC
   * @param {String} sort 自定义排序方式 'createTime'
   * @return {Array}
   */
  queryPageByCondition(params) {
    return xjaxios.post("scanRecord/queryPageByCondition", params);
  },
  // /**
  //  * @description: 条件查询
  //  * @param null *
  //  * @return {Object}
  //  */
  getByCondition(params) {
    return xjaxios.post("scanRecord/queryByCondition", {
      organizationNo: sessionStorage.organizationNo,
      ...params
    });
  },
  getByNo(no) {
    return xjaxios.get(`scanRecord/queryByNo?no=${no}`);
  },
  /**
   * @description: 新增
   * @param {Object} formData *
   * @return {Object}
   */
  add(formData) {
    // formData.organizationNo = sessionStorage.baseId;
    return xjaxios.post("scanRecord/add", {
      organizationNo: sessionStorage.organizationNo,
      ...formData
    });
  },
  /**
   * @description: 编辑
   * @param {Object} formData *
   * @return {Object}
   */
  edit(formData) {
    return xjaxios.post("scanRecord/edit", formData);
  },
  /**
   * @description: 单个删除
   * @param {String} employeeId *
   * @return {Array}
   */
  del(no) {
    return xjaxios.get(`scanRecord/delByNo?no=${no}`);
  },
  delList(noList) {
    return xjaxios.post(`scanRecord/delListByNo`, { noList: noList });
  }
};
